xend: Fix bug in superpage flag handling
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 9 Oct 2009 07:53:42 +0000 (08:53 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 9 Oct 2009 07:53:42 +0000 (08:53 +0100)
During testing I discovered that using a bootloader magically clears
the superpage flag out of the config.  This small patch fixes that
behavior.

From: Dave McCracken <dcm@mccr.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/python/xen/xend/XendConfig.py

index ac5f66c675416482e18fe5da560e0430381c242e..347639920edd0c0aa6e52015b03cd606301a1502 100644 (file)
@@ -2017,7 +2017,9 @@ class XendConfig(dict):
             self['use_tmp_kernel'] = False
             self['use_tmp_ramdisk'] = False
 
-        self['superpages'] = sxp.child_value(image_sxp, 'superpages',0)
+        val = sxp.child_value(image_sxp, 'superpages')
+        if val is not None:
+            self['superpages'] = val
 
         for key in XENAPI_PLATFORM_CFG_TYPES.keys():
             val = sxp.child_value(image_sxp, key, None)